package com.itc.bi.utils;

import com.itc.bi.utils.FilterComponent.Node;

public class FilterComponentUtil {

    static StringBuffer buffer = new StringBuffer();

    private static String expresse(Node node){
        if(node.getFiedlList().size()>0){
            node.getFiedlList().stream().forEach( item -> {
                buffer.append(item.getFieldName()).append(node.getOperator());
            });
        }
        if(node.getNodeList().size()>0){
            node.getNodeList().stream().forEach(item -> {
                buffer.append("(");
                expresse(item);
                buffer.append(")");
                buffer.append(node.getOperator());
            });
            buffer.delete(buffer.length()-1,buffer.length());
        }else{
            buffer.delete(buffer.length()-1,buffer.length());
        }
        return null;
    }
}
